﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UCL.Powersource.TFS;

namespace UCL.Powersource.Mock
{
    public class DummyVSEnv : IVSEnv
    {

        public string Uri { get; set; }

        public void ExecuteCommand(string command)
        {
            if (command == "Team.ConnecttoTeamFoundationServer")
                if (!String.IsNullOrEmpty(Uri))
                {
                    _TeamFoundationServerExt.DummyProjectContext = new DummyProjectContextExt(Uri);
                }
        }

        public DummyTeamFoundationServerExt _TeamFoundationServerExt;

        public ITeamFoundationServerExt TeamFoundationServerExt
        {
            get 
            {
                if (_TeamFoundationServerExt == null) _TeamFoundationServerExt = new DummyTeamFoundationServerExt();
                return _TeamFoundationServerExt; 
            }
        }

        public void SetTfsContext(ITfsTeamProjectCollection TeamProjectCollection, string TeamUri, bool IsTfsConnected)
        {
            if (TeamProjectCollection == null) _TeamFoundationServerExt.DummyProjectContext = null;
            else
                _TeamFoundationServerExt.DummyProjectContext = new DummyProjectContextExt(TeamProjectCollection.Uri.ToString());
                //if (string.IsNullOrEmpty(TeamUri))
                //{
                //    _TeamFoundationServerExt.DummyProjectContext = new DummyProjectContextExt(TeamProjectCollection.Uri.ToString());
                //}
                //else
                //{
                    
                    
                //}

        }
    }
}
